﻿
@{
    ViewBag.Title = "UploadDatas";
    Layout = "~/Areas/Manage/Views/Shared/_SubPage.cshtml";
}
@section Header{}
@section Footer{
    <script type="text/javascript">
        var ejApp = angular.module('ejapp', ['angular-icheck']);
        ejApp.controller('mainCtrl', [
            '$scope', '$http', function ($scope, $http) {

                $scope.doRemoves = function () { 
                  EJ.confimWarn('确定要清空本地所有文件吗?', function () {
                      $http.post("/Manage/Coupon/EmptyFile")
                                .success(function (rsp) {
                                    if (rsp.Success) {
                                        EJ.showSuccess("清空成功");                                     
                                    } else {
                                        EJ.showError(rsp.Message);
                                    }
                                })
                                .error(errorFn);
                        });                    
                };

                  @if(ViewBag.Result!=null)
                  {
                      if (ViewBag.Result.IsSuccess) {
                          @Html.Raw("EJ.showSuccess('" + ViewBag.Result.Message + "');")
                      }
                      else {
                          @Html.Raw("EJ.showError('"+ ViewBag.Result.Message + "');")
                      }
                  }
            }
        ])
       
      
    </script>
}
<div class="wrapper wrapper-content animated fadeInUp">
    <div class="row animated slideInLeft">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>导入表格数据 </h5>
                    <div class="ibox-tools">                   
                        <button type="button" ng-click="doRemoves()" class="btn btn-danger btn-xs">清空文件&nbsp;<i class="fa fa-trash-o"></i></button>                    
                    </div>
                </div>
                <div class="ibox-content">
                    <form action="/Manage/Coupon/UploadDatas" enctype="multipart/form-data" method="post" class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">文件</label>
                            <div class="col-sm-10">
                                <input type="file" required name="file" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit">保存</button>
                                <button class="btn btn-white" type="reset">取消</button>                            
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
